{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 条件判断\n",
    "\n",
    "```\n",
    "if <条件判断1>:\n",
    "    <执行1>\n",
    "elif <条件判断2>:\n",
    "    <执行2>\n",
    "elif <条件判断3>:\n",
    "    <执行3>\n",
    "else:\n",
    "    <执行4>\n",
    "```\n",
    "\n",
    "注意条件判断后面必须要有冒号`:`\n",
    "\n",
    "elif可以有0个或多个\n",
    "\n",
    "简写`if`判断条件\n",
    "\n",
    "```\n",
    "if x:\n",
    "    print(True)\n",
    "````\n",
    "\n",
    "只要`x`是非零数值、非空字符串、非空`list`等，就判断为`True`，否则为`False`。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
